<div class="login" id="login">
    <div class="wrap">
        <h1><?php echo UserModule::t("Login"); ?></h1>

        <?php if (Yii::app()->user->hasFlash('loginMessage')) { ?>
            <div class="alert alert-success">
                <button type="button" class="close" data-dismiss="alert">×</button>
                <?php echo Yii::app()->user->getFlash('loginMessage'); ?>
            </div>
        <?php } ?>

        <?php
        $form = $this->beginWidget('CActiveForm', array(
            'id' => 'validate',
            'enableClientValidation' => true,
            'clientOptions' => array(
                'validateOnSubmit' => true,
            ),
        ));
        ?>
        
        <?php if ($model->getErrors()) { ?> 
                        <div class="alert alert-error">
                            <button type="button" class="close" data-dismiss="alert">×</button>
                            <?php echo $form->errorSummary(array($model)); ?>
                        </div>
                    <?php }; ?>

        <?php $field = 'username'; ?>
        <div class="row-fluid">
            <div class="input-prepend">
                <span class="add-on"><i class="icon-envelope"></i></span>
                <?php
                echo $form->textField($model, $field, array(
                    'placeholder' => 'Ваша электронная почта',
                ))
                ?>
            </div>      

            <?php $field = 'password'; ?>
            <div class="input-prepend">
                <span class="add-on"><i class="icon-exclamation-sign"></i></span>
                <?php
                echo $form->passwordField($model, $field, array(
                    'placeholder' => 'Ваша пароль',
                ))
                ?>
            </div>          
            <div class="dr"><span></span></div>                                
        </div> 


        <div class="row-fluid">
            <div class="span8 remember">           
                <?php echo CHtml::activeCheckBox($model,'rememberMe'); ?>
		<?php echo strip_tags(CHtml::activeLabelEx($model,'rememberMe')); ?>              
            </div>
            <div class="span4    TAR">
<?php echo CHtml::submitButton('Войти', array('class' => 'btn btn-block btn-primary')); ?>
            </div>
        </div>
<?php $this->endWidget(); ?>


        <div class="dr"><span></span></div>
        <div class="row-fluid">
            <div class="span8">                    
                <button class="btn btn-block" onClick="return location.href = '/cabinet.php?r=user/recovery'">Забыли пароль?</button>
            </div>
            <div class="span4">
                <button class="btn btn-warning btn-block" onClick="return location.href = '/signup'">Регистрация</button>
            </div>
        </div>            
    </div>
</div>